package task;

import java.util.Scanner;
    public class taskone {

        public class Main {
            public static int[] eliminateDuplicates(int[] list) {
                int[] newArray = new int[list.length];
                int index = 0;
                for (int i = 0; i < list.length; i++) {
                    boolean isDuplicate = false;
                    for (int j = 0; j < i; j++) {
                        if (list[i] == list[j]) {
                            isDuplicate = true;
                            break;
                        }
                    }
                    if (!isDuplicate) {
                        newArray[index] = list[i];
                        index++;
                    }
                }
                int[] finalArray = new int[index];
                for (int i = 0; i < index; i++) {
                    finalArray[i] = newArray[i];
                }
                return finalArray;
            }

            public static void main(String[] args) {
                Scanner scanner = new Scanner(System.in);
                System.out.println("Please enter an integer array:");
                int[] list = new int[10];
                for (int i = 0; i < 10; i++) {
                    list[i] = scanner.nextInt();
                }
                int[] result = eliminateDuplicates(list);
                System.out.println("The result is as follows:");
                for (int i = 0; i < result.length; i++) {
                    System.out.print(result[i] + " ");
                }
            }
        }
    }

